package com.zx.erp.purchase.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zx.erp.purchase.bean.CBrand;
import com.zx.erp.purchase.bean.CPurchase;
import com.zx.erp.purchase.bean.PurchaseCondition;
import com.zx.erp.purchase.mapper.CPurchaseMapper;
import com.zx.erp.purchase.service.CPurchaseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zx.erp.sys.bean.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 作者信息
 * @since 2021-11-10
 */
@Service
public class CPurchaseServiceImpl extends ServiceImpl<CPurchaseMapper, CPurchase> implements CPurchaseService {

    @Autowired
    private CPurchaseMapper mapper;


    @Override
    public Page<CPurchase> getPurchaseListByCondition(PurchaseCondition conn, Integer pageNo, Integer pageSize, Users users) {
        Page<CPurchase> page = new Page<CPurchase>(pageNo,pageSize);
        Page<CPurchase> pageInfo = mapper.getPurchaseListByCondition(page, conn,users);
        return pageInfo;
    }
    @Override
    public CPurchase findByPid(String purchaseId) {
        return mapper.findByPid(purchaseId);
    }
    @Override
    public Boolean update(CPurchase cPurchase) {
        return mapper.update(cPurchase);
    }
}
